 //  slice(start,end)
 
 
 
 //  1.chunk
  var arr =  ['a', 'b', 'c', 'd']
  var chunk = 2
  var arr2 = [];
// => [['a', 'b'], ['c', 'd']]

// arr2.push(arr.slice(0,chunk))
// arr2.push(arr.slice(2,chunk+2))

for(let i = 0; i<arr.length; i++){
  if(i/chunk%1 === 0){
    // console.log(i)
    arr2.push(arr.slice(i,chunk+i))
  }
}

console.log(arr2)

   
var arr = ['a', 'b', 'c', 'd', 'e', 'f', 'g']
var chunk = 3;
var arr2 = [];
// => [['a', 'b', 'c'], ['d', 'e', 'f'], ['g']]


for(let i = 0; i<arr.length; i++){
  if(i/chunk%1 === 0){
    // console.log(i)
    arr2.push(arr.slice(i,chunk+i))
  }
}
console.log(arr2)